<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>管理员后台系统</title>
    <link rel="stylesheet" th:href="@{/static/css/minireset.css}" />
    <link rel="stylesheet" th:href="@{/static/css/common.css}" />
    <link rel="stylesheet" th:href="@{/static/css/cart.css}" />
    <link rel="stylesheet" th:href="@{/static/css/bookManger.css}" />
    <link rel="stylesheet" th:href="@{/static/css/orderManger.css}" />
    <script language="JavaScript" th:src="@{/static/script/admin.js}"></script>
</head>
<body>
<div class="header">
    <div class="w">
        <div class="header-left">
            <h1>用户名单</h1>
        </div>
        <div class="header-right">
            <h3>欢迎<span th:text="${session.loginuser.user_name}">张总</span>光临商城</h3>
            <a th:href="@{/page.do?operate=page&page=login}" class="register">注销</a>
            <div class="gohome">
                <a th:href="@{/Commodity.do}">返回</a>
            </div>
        </div>
    </div>
</div>
<div class="list">
    <div class="w">
        <table>
            <thead>
            <tr>
                <th>用户名</th>
                <th>角色</th>
                <th>状态</th>
                <th>操作</th>
                <th>商家商品</th>

            </tr>
            </thead>
            <tbody>
            <tr th:each="User : ${session.userList}" th:object="${User}">
                <td th:text="*{user_name}"></td>
                <td>
                    <p th:if="*{role==3}">配送员</p>
                    <p th:if="*{role==2}">普通用户</p>
                    <p th:if="*{role==1}">店家</p>
                    <p th:if="*{role==0}">管理员</p>
                </td>
                <td>
                    <p th:if="*{state==1}" style="color: #2dff2a">正常</p>
                    <p th:if="*{state==0}" style="color: #ff1018">封禁中</p>
                </td>
                <td>
                    <button th:if="*{state==1}" th:onclick="|ban(*{user_ID},0)|">封禁</button>
                    <button th:if="*{state==0}" th:onclick="|ban(*{user_ID},1)|">解封</button>
                </td>
                <td>
                    <a th:if="*{role==1}" th:href="@{|/Commodity.do?operate=shop&ID=*{user_ID}|}" class="cart iconfont ">
                        查看店铺详情
                    </a>
                    <p th:if="*{role==3}">配送员无商品</p>
                    <p th:if="*{role==2}">普通用户无商品</p>
                    <p th:if="*{role==0}">管理员无商品</p>
                </td>
            </tr>

            </tbody>
        </table>

    </div>
</div>
</body>
</html>
